package day09;

import java.util.HashSet;
import java.util.Set;

public class HashEqualsDemo {
    public static void main(String[] args) {
        Set<User> sets = new HashSet<>();
        User u1 = new User(1,"admin");

        System.out.println(u1.getClass().getName()+"@"+Integer.toHexString(u1.hashCode()));
        User u2 = new User(2,"tom");
        User u3 = new User(3,"jack");
        User u4 = new User(1,"admin");

        sets.add(u1);
        sets.add(u2);
        sets.add(u3);

        sets.add(u4);
        User u5 = new User(3,"jack");
        System.out.println("=======remove========");
        sets.remove(u5);
        for(User  set:sets){
            System.out.println(set);
        }
    }
}
